import About from "../page/About";
import Board from "../page/Board";
import Home from "../page/Home";
import Layout from "../page/Layout";
import Login from "../page/Login";
import { createBrowserRouter } from "react-router-dom";
import NotFound from "../page/NotFund";
const router = createBrowserRouter([
    {
        path: "/",
        element: <Layout />,
        children: [
            {
                // 设置为默认二级路由，一级路由访问时，它也能都得到渲染
                index: true,
                element: <About />
            },
            {
                path: "board",
                element: <Board />
            }
        ]
    },
    {
        path: "/home/:id",
        element: <Home />
    },
    {
        path: "/login",
        element: <Login />
    },
    {
        path:"*",
        element:<NotFound/>
    }
]);
export default router;